<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="//cdn.bootcss.com/angular.js/1.5.8/angular.min.js"></script>
    <title>ng-if事件</title>
</head>
<body ng-app="">
保留 HTML:<input type="checkbox" ng-model="myVar" ng-init="myVar=true">
<h1>{{myVar}}</h1>
<div ng-if="myVar">
    <h1>Welcome</h1>
    <p>Welcome to my home.</p>
    <hr>
</div>
<p>当复选框取消选中时 DIV元素将移除。</p>
<p>当重新选中复选框，DIV元素会重新显示。</p>
</body>
</html>